package com.big.pay.listener;

import com.big.model.model.pay.PayLog;
import com.big.pay.config.RabbitConfig;
import com.big.pay.service.PayLogService;
import com.rabbitmq.client.Channel;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class PayListener {

    @Autowired
    PayLogService payLogService;


    //监听支付
    @RabbitListener(queues = RabbitConfig.QUEUE_PAY_ITEM)
    public void onPay(PayLog payLog, Channel channel , Message message){
        Integer save = payLogService.savePayLog(payLog);
    }




}
